<%@ Page EnableEventValidation="False" Title="Search for Lend" Language="C#" MasterPageFile="~/Pages/user/userMaster.Master" AutoEventWireup="true" CodeBehind="SearchLend.aspx.cs" Inherits="WarehouseWebAPP.Pages.user.Search_Pages.SearchLend" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <style type="text/css">
        .style13
        {
            height: 23px;
        }
        .style16
        {
        }
        .style34
     {
         width: 213px;
     }
     .style35
     {
         width: 108px;
     }
     </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table style="margin-right: 0px">
    <tr>
        <td class="style34">
            <asp:Label ID="Label5" runat="server" Text="User"></asp:Label>
        </td>
        <td class="style35" >
            <cc1:ComboBox ID="UserComboBox" runat="server" AppendDataBoundItems="True" 
                AutoCompleteMode="Append" DropDownStyle="DropDownList" 
                ondatabound="UserComboBox_DataBound" DataSourceID="UserObjectDataSource" 
                DataTextField="user_name" DataValueField="user_num" MaxLength="0" 
                style="display: inline;">
            </cc1:ComboBox>
        </td>
        <td>
            <asp:Label ID="Label6" runat="server" Text="Customer"></asp:Label>
        </td>
            <td>
            <cc1:ComboBox ID="CustomerComboBox" runat="server" AppendDataBoundItems="True" 
                AutoCompleteMode="Append" DropDownStyle="DropDownList" 
                ondatabound="CustomerComboBox_DataBound" 
                DataSourceID="CustomerObjectDataSource" DataTextField="customer_name" 
                DataValueField="customer_num" MaxLength="0" style="display: inline;">
            </cc1:ComboBox>
            </td>
            
    </tr>
        <tr>
            <td class="style34">
                <asp:Label ID="Label1" runat="server" Text="Start Date Between"></asp:Label>
            </td>
            <td class="style35">
                <asp:TextBox ID="SDFTextBox" runat="server" ReadOnly="True"></asp:TextBox>
                <cc1:MaskedEditExtender ID="SDFTextBox_MaskedEditExtender" runat="server" 
                    Mask="99/99/9999" MaskType="Date" TargetControlID="SDFTextBox" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="SDFTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="SDFTextBox">
                </cc1:CalendarExtender>
            </td>
            <td>
                <asp:Label ID="Label10" runat="server" Text="And"></asp:Label>
            </td>
            <td >
                <asp:TextBox ID="SDTTextBox" runat="server"></asp:TextBox>
                <cc1:MaskedEditExtender ID="SDTTextBox_MaskedEditExtender" runat="server" 
                    TargetControlID="SDTTextBox" Mask="99/99/9999" MaskType="Date" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="SDTTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="SDTTextBox">
                </cc1:CalendarExtender>
            </td>
        </tr>
        <tr>
            <td class="style34">
                <asp:Label ID="Label8" runat="server" Text="End Date Between" 
                Width="137px"></asp:Label>
            </td>
            <td class="style35">
                <asp:TextBox ID="EDFTextBox" runat="server"></asp:TextBox>
                <cc1:MaskedEditExtender ID="EDFTextBox_MaskedEditExtender" runat="server" 
                    TargetControlID="EDFTextBox" Mask="99/99/9999" MaskType="Date" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="EDFTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="EDFTextBox">
                </cc1:CalendarExtender>
            </td>
            <td>
                <asp:Label ID="Label13" runat="server" Text="And" Width="34px"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="EDTTextBox" runat="server"></asp:TextBox>
                <cc1:MaskedEditExtender ID="EDTTextBox_MaskedEditExtender" runat="server" 
                    TargetControlID="EDTTextBox" Mask="99/99/9999" MaskType="Date" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="EDTTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="EDTTextBox">
                </cc1:CalendarExtender>
            </td>
        </tr>
        <tr>
            <td class="style34">
                <asp:Label ID="Label9" runat="server" Text="Returned Date Between" 
                Width="155px"></asp:Label>
            </td>
            <td class="style35">
                <asp:TextBox ID="RDFTextBox" runat="server"></asp:TextBox>
                <cc1:MaskedEditExtender ID="RDFTextBox_MaskedEditExtender" runat="server" 
                    TargetControlID="RDFTextBox" Mask="99/99/9999" MaskType="Date" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="RDFTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="RDFTextBox">
                </cc1:CalendarExtender>
            </td>
            <td >
                <asp:Label ID="Label14" runat="server" Text="And" 
                Width="34px"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="RDTTextBox" runat="server"></asp:TextBox>
                <cc1:MaskedEditExtender ID="RDTTextBox_MaskedEditExtender" runat="server" 
                    TargetControlID="RDTTextBox" Mask="99/99/9999" MaskType="Date" 
                    UserDateFormat="DayMonthYear">
                </cc1:MaskedEditExtender>
                <cc1:CalendarExtender ID="RDTTextBox_CalendarExtender" runat="server" 
                    Format="dd/MM/yyyy" TargetControlID="RDTTextBox">
                </cc1:CalendarExtender>
            </td>
        </tr>
        <tr>
            <td class="style34">
            <asp:Label ID="Label7" runat="server" Text="Item"></asp:Label>
            </td>
            <td class="style35">
            <cc1:ComboBox ID="ItemComboBox" runat="server" AppendDataBoundItems="True" 
                AutoCompleteMode="Append" DropDownStyle="DropDownList" 
                ondatabound="ItemComboBox_DataBound" DataSourceID="ItemObjectDataSource" 
                DataTextField="lend_item_serial" DataValueField="lend_item_num" MaxLength="0" 
                style="display: inline;">
            </cc1:ComboBox>
            </td>
            <td >
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td bgcolor="#E3E6EA" colspan="3">
            </td>
            <td bgcolor="#E3E6EA">
            <asp:Button ID="Button1" runat="server" BackColor="#FFFBFF" 
 BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"  
 Font-Names="Verdana" Font-Size="Small" ForeColor="#284775" Text="Search" Width="76px" 
                onclick="Button1_Click"/>
            </td>
        </tr>
    <tr>
        <td colspan="4">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="LendGridView" runat="server" AutoGenerateColumns="False" 
                CellPadding="4" DataKeyNames="lend_num" DataSourceID="LendObjectDataSource" 
                ForeColor="#333333" GridLines="None" AllowPaging="True"
                AllowSorting="True" ondatabound="LendGridView_DataBound" 
    Width="671px">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <Columns>
                            <asp:BoundField DataField="lend_num" HeaderText="lend_num" ReadOnly="True" 
                        SortExpression="lend_num" Visible="False" />
                            <asp:TemplateField HeaderText="Lending User" SortExpression="lend_user">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("lend_user") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="UserLabel" runat="server" Text='<%# Bind("lend_user") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Customer" SortExpression="lend_customer">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("lend_customer") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="CustomerLabel" runat="server" 
                                Text='<%# Bind("lend_customer") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Item" SortExpression="lend_item_num">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("lend_item_num") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="ItemLabel" runat="server" Text='<%# Bind("lend_item_num") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="lend_start_date" HeaderText="Start Date" 
                        SortExpression="lend_start_date" />
                            <asp:BoundField DataField="lend_end_date" HeaderText="End Date" 
                        SortExpression="lend_end_date" />
                            <asp:BoundField DataField="lend_returned_date" HeaderText="Returned Date" 
                        SortExpression="lend_returned_date" />
                        </Columns>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                            HorizontalAlign="Left" />
                        <EditRowStyle BackColor="#999999" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:GridView>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
            </td>
    </tr>
    <tr>
        <td class="style10" colspan="4">
            <asp:LinkButton ID="ExcelButton" runat="server" onclick="ExcelButton_Click" 
                Width="124px">Export 
            to Excel</asp:LinkButton>
            <asp:ObjectDataSource ID="LendObjectDataSource" runat="server" 
                SelectMethod="LendSearch" 
                TypeName="WarehouseWebAPP.code.BLL.LendBLL" 
                OldValuesParameterFormatString="original_{0}">
                <SelectParameters>
                    <asp:ControlParameter ControlID="ItemComboBox" Name="lend_item_num" 
                        PropertyName="SelectedValue" Type="String" 
                        DefaultValue="%" />
                    <asp:ControlParameter ControlID="UserComboBox" Name="lend_user" 
                        PropertyName="SelectedValue" Type="String" 
                        DefaultValue="" />
                    <asp:ControlParameter ControlID="CustomerComboBox" Name="lend_customer" 
                        PropertyName="SelectedValue" Type="String" DefaultValue="%" />
                    <asp:ControlParameter ControlID="SDFTextBox" DefaultValue="1/1/1753" 
                        Name="lend_start_date_from" PropertyName="Text" Type="DateTime" />
                    <asp:ControlParameter ControlID="SDTTextBox" DefaultValue="1/1/2200" 
                        Name="lend_start_date_to" PropertyName="Text" Type="DateTime" />
                    <asp:ControlParameter ControlID="EDFTextBox" DefaultValue="1/1/1753" 
                        Name="lend_end_date_from" PropertyName="Text" Type="DateTime" />
                    <asp:ControlParameter ControlID="EDTTextBox" DefaultValue="1/1/2200" 
                        Name="lend_end_date_to" PropertyName="Text" Type="DateTime" />
                    <asp:ControlParameter ControlID="RDFTextBox" DefaultValue="1/1/1753" 
                        Name="lend_returned_date_from" PropertyName="Text" Type="DateTime" />
                    <asp:ControlParameter ControlID="SDTTextBox" DefaultValue="1/1/2200" 
                        Name="lend_returned_date_to" PropertyName="Text" Type="DateTime" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="ItemObjectDataSource" runat="server" 
                SelectMethod="lendItemGet" TypeName="WarehouseWebAPP.code.BLL.LendItemBLL">
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="CustomerObjectDataSource" runat="server" 
                SelectMethod="CustomerGet" TypeName="WarehouseWebAPP.code.BLL.CustomerBLL">
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="UserObjectDataSource" runat="server" 
                SelectMethod="userGet" TypeName="WarehouseWebAPP.code.BLL.UserBLL">
            </asp:ObjectDataSource>
        </td>
    </tr>
    </table>
</asp:Content>
